home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / appkit.801 < prev    next >
Text File  |  1992-02-06  |  2KB  |  34 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Courier;\f2\fswiss Helvetica;}
  2. \paperw9840
  3. \paperh12100
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ul0\fs28\fc0 Hide on auto-launch pitfalls bug workaround
  8. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  9. \
  10.  
  11. \fc0 Q:  How do you make an application hide when it's auto-launched from the dock?\
  12. \
  13. Q:  I'm having trouble getting my application to hide when auto-launched.  What's the correct way to make it happen?\
  14. \
  15. A:  When your application launches, it should check the 
  16. \f1\fs24 NXAutoLaunch
  17. \f0\fs28  default.  A “NO” value means the application wasn't auto-launched from the Dock, and a “YES” value means it was.  The application should check this value before creating or displaying any user interface.  It should complete its initialization when the user activates it for the first time (the code for detecting and handling this condition should reside within the 
  18. \f1\fs24 appDidUnhide:
  19. \f0\fs28  delegate method).\
  20. \
  21. Another approach might be to completely initialize the application and then check the default.  If the auto-launch condition were true, it could send itself the 
  22. \f1\fs24 hide:
  23. \f0\fs28  message and disappear.  The first problem with this approach is that it leads to flashing windows, meaning that if (for example) your application creates a default document or displays a palette when it starts up,  the window or palette will appear onscreen, and then quickly disappear when the application hides itself.  The second problem is that some timing snarls in the AppKit currently prevent this (sending the 
  24. \f1\fs24 hide:
  25. \f0\fs28  message from within 
  26. \f1\fs24 appDidInit:
  27. \f0\fs28 ) from working.\
  28. \
  29. QA801\
  30. \
  31. Valid for 2.0\
  32. \
  33.  
  34.